import React from "react";
import { getImageUrl } from "./util.tsx";

type Person = {
	name: string;
	age: number;
}
type AvatarProps = {
	person: Person;
	size: number;
}
const Avatar:React.FC<AvatarProps> = ( {person, size}) => {
	return (
		<img className="avatar"
			src={getImageUrl(person)}
			alt={person.name}
			width={size}
			height={size}
		/>
	);
}
export default Avatar;